/**
 * @(#)MySQLDialect.java 2010-3-24
 * 
 * Copyright (c) 2000-2010 by ChinanetCenter Corporation.
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * ChinanetCenter Corporation ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ChinanetCenter.
 * 
 */

package com.szf.base.dao;


/**
 * MySQL方言
 * 
 * @author 刘圳
 * @version 1.0 2010-3-24
 * @since 1.0
 */
public class MySQLDialect extends Dialect {

	@Override
	public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit,
			String limitPlaceholder) {
		if (offset > 0) {
			return sql + " limit " + offsetPlaceholder + "," + limitPlaceholder;
		}
		else {
			return sql + " limit " + limitPlaceholder;
		}
	}

	@Override
	public boolean supportsLimit() {
		return true;
	}

	@Override
	public boolean supportsLimitOffset() {
		return true;
	}

}
